In three-dimensional graphics processing, a z value is typically maintained for each pixel of a display screen. This z value provides an indication of how “deep” into the display screen the item represented by a pixel resides. For example, suppose that a pixel representing a current item (e.g. a portion of a tree) that is currently being displayed has a z value of Z0. Suppose further that a new item (e.g. a portion of a car) moves into the same pixel space as the current item, and that the new item has a z value of Z1 for that pixel. Since both items are rasterized to the same pixel, it is not possible for the pixel to display both items; thus, a choice has to be made. To make the choice, the z values of the two items are compared. If Z1 is less than Z0 (thereby indicating that the new item is less deep, and hence, is in front of the current item), then the pixel displays the new item, and the z value of the pixel is updated to Z1. On the other hand, if Z1 is greater than Z0 (thereby indicating that the new item is deeper, and hence, is behind the current item), then the pixel displays the current item, and the z value of the pixel is maintained at Z0. Implemented in this manner, the z value associated with a pixel is the z value of the item rasterized to that pixel that has the least depth.
The z values for the various pixels of a display are typically stored in a z buffer. Since there is a z value associated with each pixel, if a display has X horizontal pixels and Y vertical pixels, there will be an X times Y number of z values stored in the z buffer. For high-resolution displays, this can be a very large amount of information. Typically, the z buffer is read from and written to whenever a new display screen is generated. Given the large amount of information stored in the z buffer, these read and write operations can lead to enormous amounts of traffic between the z buffer and a graphics processing unit (GPU) which uses the information in the z buffer to generate display screens. It has been observed that this high traffic volume leads to slower processing performance. Consequently, to improve system performance, it is desirable to reduce z buffer traffic.
Some prior attempts have been made to reduce z buffer traffic. These efforts have led to the development of such methodologies as hierarchical z, two-pass rendering, and image-based z compression. Due to various reasons, however, such as low compression ratios, low efficiency, and limited application (e.g. application only to buffer reads and not writes), these methodologies have failed to yield satisfactory results. As a result, a mechanism, which reduces z buffer traffic more effectively, is needed.